/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pnt.message;

import java.net.InetSocketAddress;
import pnt.message.objects.*;

/**
 *
 * @author andrew
 */
public class Request_DiscoverNEP extends Request {

    User from;
    InetSocketAddress pvtendpoint;
    
    public Request_DiscoverNEP( int transaction,
                        User from,
                        InetSocketAddress pvtendpoint){
        super(transaction,Request.RequestType.DISCOVER_NEP);
        this.from = from;
        this.pvtendpoint = pvtendpoint;
    }
    
    @Override
    public String toString(String endChar, String term) {
        
        String s  = "DISCOVER-NEP * PNT/1.0" + endChar +
                    "Transaction: " + getTransactionNumber() + endChar +
                    "From: " + from.toString() + endChar +
                    "Pvt-Endpoint: " + Utils.formatSocketAddress(pvtendpoint) + term;
             
        return s;
    }

    @Override
    public byte[] toBytes() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

	public User getFrom() {
		return from;
	}

	public InetSocketAddress getPvtendpoint() {
		return pvtendpoint;
	}

}
